<%@page import="com.tubeilike.model.CategoryModel"%>
<%@page import="com.tubeilike.entity.Tube"%>
<%@page import="com.google.appengine.api.users.User"%>
<%@page import="com.tubeilike.entity.Category"%>
<%@page import="java.util.*"%>
<%@page import="com.google.appengine.api.users.UserService"%>
<%@page import="com.google.appengine.api.users.UserServiceFactory"%>
<%@page import="com.google.appengine.api.blobstore.BlobstoreServiceFactory"%>
<%@page import="com.google.appengine.api.blobstore.BlobstoreService"%>
<%
	BlobstoreService blobstoreService = BlobstoreServiceFactory
			.getBlobstoreService();
%>
<%	
	request.setCharacterEncoding("UTF-8");	
	String url = request.getRequestURI();	
	List<Tube> listTube = (List<Tube>) request.getAttribute("result");
	Category cate = (Category) request.getAttribute("cate");
	String title = cate.getTitle().getValue() + " Playlist - TubeOnFire";
	String description = "Mix something from youtube. Create an video playlist in seconds";
	String keyword = "video clip, youtube, mix clip, tubeonfire.com, tubeonfire, your clip...";
	if(cate!=null){
%>
<jsp:include page="/element/header.jsp">	
	<jsp:param name="url" value="<%= url %>"/>
	<jsp:param name="title" value="<%=title %>"/>	
	<jsp:param name="keywords" value="<%=keyword %>"/>
	<jsp:param name="description" value="<%=description %>"/>
</jsp:include>
<div class="clear"></div>    
<section id="wrapper">		
	<div class="one last" style="padding-top:5px; overflow:hidden;">				 
		<div class="profile-toolbox-bl" id="miniheader">
		    <div class="profile-toolbox-br">
		        <div class="profile-toolbox-tl">
		        <%		        	
					UserService userService = UserServiceFactory.getUserService();
					User user = userService.getCurrentUser();
				%>
		            <div style="float: left; padding: 5px">
						<div style="float: left; width: 40px;">
						    <a href="#">
								<img src="/image?key=<%=cate.getThumbImageUrl().getValue() %>" style="height: 46px" alt="User 19" class="cAvatar">
							</a>
						</div>
							<div style="margin: 0 0 0 100px;">						
								<a href="/admin/category/manager">Category Manager</a> (<a href="/admin/category/create">Create New</a>) 		
							</div>
							<div style="margin: 0 0 0 100px;">						
								Category: <%=cate.getTitle().getValue() %>				
							</div>								
					</div>		
					<%
						if(user!=null){
					%>	
						<div style="float:right;">
							<ul class="small-button" style="padding-top:5px;">
								 <li><a class="button big red icon mailopened" href="#">Send Message</a>
								</li>
								  <li><a class="button big red icon newspaper" href="#">Wall</a>
								</li>
								 <li><a class="button big red icon play" href="#">Videos</a>
								</li>
								 <li><a class="button big red icon heart" href="#">Likes</a>
								</li>
							</ul>
						</div>
					<%} %>
					<div style="clear: both;"></div>
				</div>
			</div>
		</div>

<script type="text/javascript" src="/js/swfobject.js"></script>
<div id="mediaspace" style="width:955px; margin:0 auto; padding:1px;"><embed type="application/x-shockwave-flash" src="http://videoinedit.com/components/player/player.swf" width="955" height="400" style="undefined" id="mpl" name="mpl" quality="high" allowfullscreen="true" allowscriptaccess="always" wmode="opaque" flashvars="playlistfile=http://videoinedit.com/xml_playlist.php?id=54&amp;skin=http://videoinedit.com/components/player/stormtrooper.zip&amp;image= http://videoinedit.com/uploads/playlists1333012318fer-katherine-gates.jpg&amp;controlbar=bottom&amp;playlistsize=300&amp;playlist=right&amp;repeat=list&amp;hd.file=&amp;autostart=false&amp;dock=true&amp;youtube.quality=large&amp;plugins=hd-1,like-1,timeslidertooltipplugin-2&amp;stretching=fill"></div>

<%
	Tube tub = new Tube();
	String cateFile="";
	if(listTube!=null&&listTube.size()>0){		
		cateFile = "/rss-playlist?cateAlias=" + cate.getAlias();
	}
%>

<script type="text/javascript">
  var so = new SWFObject('/css/player.swf','mpl','955','400','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');  
  so.addVariable('playlistfile','<%=cateFile%>');
  so.addVariable('skin','/css/stormtrooper.zip');
  so.addVariable('image','');
  so.addVariable('controlbar','bottom');  
  so.addVariable('playlistsize','300');  
  so.addVariable('playlist','right');  
  so.addVariable('repeat','list');  
  so.addVariable('hd.file','');
  so.addVariable('autostart','true');
  so.addVariable('dock', 'true');
  so.addVariable('youtube.quality','large'); 
  so.addVariable('stretching','fill');
  so.write('mediaspace');
</script>
         
<div class="one" style="margin:15px;width:960px; overflow:hidden;">

<div class="clear" style="height:15px;"></div>
<%
	if(listTube!=null&&listTube.size()>0){
%>
<h2 class="title-line alignright">All categories</h2>
<div class="clear" style="height:10px;"></div>
 	<div id="channel-box" style="padding:10px 25px;">
 		<%
 			for(Category item: CategoryModel.all()){
 		
 		%>
	 	<div class="channel-box ">
	 		<div class="overflow-hidden">
	 			<a href="/admin/category/view?alias=<%=item.getAlias() %>" title="<%= item.getTitle().getValue()%>">
					<span class="channel-box-hover"><span class="hover-video"></span></span>
				</a>
				<img src="<%=item.getThumbImageUrl().getValue() %>" style="max-width: 220px; max-height: 150px" alt="<%=item.getTitle().getValue()%>">
			</div>
			<div class="box-body">
			<h2 class="box-title">
				<a href="/admin/category/view?alias=<%=item.getAlias() %>" rel="bookmark" title="<%=item.getTitle().getValue()%>"><%=item.getTitle().getValue()%></a>
			</h2>
			</div>
		</div> 	
		<%		
 			}
		%>				
	</div>
<%
	}
%>
<div id="fb-root" class=" fb_reset"><div style="position: absolute; top: -10000px; height: 0px; width: 0px; "></div></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=145603018795644";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>
</div>
<%
	}
%>
<div class="clear"></div>
<jsp:include page="/element/advertising_right02.jsp"/>	
<jsp:include page="/element/footer.jsp"/>	
			
		
		






